package com.cloudy.utility;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;


import com.cloudy.impl.SuccessHandler;

public class InputStreamPrint extends SuccessHandler{

	@SuppressWarnings("unchecked")
	@Override
	protected <T> T getTheResponseMessage(HttpURLConnection httpConnection)
			throws IOException {
		InputStreamReader reader = new InputStreamReader(httpConnection.getInputStream());
		BufferedReader read = new BufferedReader(reader);
		String line = "";
		String result = "";
		while((line = read.readLine())!=null){
			result +=line;	
		}
		return (T) result;
	}

}
